package com.cn.JUC.pattern.case15;


import lombok.Data;

/**
 * @Title 路由表
 * @Description 读非常多，写非常少
 * @Author CAI ZHAI
 * @Date 2021/9/13 11:28
 **/
@Data
public final class Router{
    private final String  ip;
    private final Integer port;
    private final String  iface;
    //构造函数
    public Router(String ip, Integer port, String iface){
        this.ip = ip;
        this.port = port;
        this.iface = iface;
    }
    //重写equals方法
    public boolean equals(Object obj){
        if (obj instanceof Router) {
            Router r = (Router)obj;
            return iface.equals(r.iface) && ip.equals(r.ip) && port.equals(r.port);
        }
        return false;
    }
    public int hashCode() {
        //省略hashCode相关代码
        return 0;
    }
}

